﻿@model UniTax.Models.TownModel

@using (Ajax.BeginForm("TownEdit", new AjaxOptions
{
    UpdateTargetId = "ajaxContainer",
    OnBegin = "showWaitDiv",
    OnSuccess = "hideWaitDiv"
}))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    
    <fieldset>
        <legend>Город</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <p>
            <input type="submit" value="Сохранить" />
        </p>
    </fieldset>
}

<div>
    @Ajax.ActionLink("Назад к списку городов", "TownList", new AjaxOptions
   {
       UpdateTargetId = "ajaxContainer",
       OnBegin = "showWaitDiv",
       OnSuccess = "hideWaitDiv"
   })
</div>
